import request from '@/utils/request'

// 查询知识库附属文档信息列表
export function listDoc(query) {
  return request({
    url: '/manage/doc/list',
    method: 'get',
    params: query
  })
}

// 查询知识库附属文档信息详细
export function getDoc(docId) {
  return request({
    url: '/manage/doc/' + docId,
    method: 'get'
  })
}

// 新增知识库附属文档信息
export function addDoc(data) {
  return request({
    url: '/manage/doc',
    method: 'post',
    data: data
  })
}
export function uploadDoc(data) {
  return request({
    url: '/manage/doc/upload',
    headers: {
      'Content-Type':'multipart/form-data'
    },
    method: 'post',
    data: data
  })
}
// 修改知识库附属文档信息
export function updateDoc(data) {
  return request({
    url: '/manage/doc',
    method: 'put',
    data: data
  })
}
export function solveDoc(docId) {
  return request({
    url: '/manage/doc/solve/' + docId,
    method: 'get'
  })
}
export function updateDocStatus(doc_id,status) {
  return request({
    url: '/manage/doc/updateDocStatus/' + doc_id + '/' + status,
    method: 'get'
  })
}

// 删除知识库附属文档信息
export function delDoc(docId) {
  return request({
    url: '/manage/doc/' + docId,
    method: 'delete'
  })
}
